import pyautogui
import time
import os

try:
    while True:
        x,y = pyautogui.position()
        pos = "当前鼠标位置:" + str(x) + "," + str(y)
        print(pos)
        time.sleep(1)
        # os.system("cls")  # 在用cmd运行时会进行清屏,只显示最新一次记录
except KeyboardInterrupt:
    print("end....")

